#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_LENGTH 32  

int decimalism_to_bin(int number, int* arr)
{
    int i = 0;

    while (number > 0)
    {
        arr[i] = number % 2;
        number /= 2;
        i++;
    }

    return i; 
}

int main(int argc, const char* argv[])
{
    int arr[MAX_LENGTH] = { 0 };  
    int number;  
    int bit; 

    printf("请输入一个整数：\n");
    scanf("%d", &number);
    bit = decimalism_to_bin(number, arr);

    for (int i = bit -1; i >= 0; i--)
    {
        printf("%d", arr[i]);
    }

    printf("\n");  

    return 0;
}
